package com.fc.enums;


import lombok.Getter;

@Getter
public enum TransportType implements IEnum{
    SINGLE(1, "单边"),
    BILATERAL(2, "往返");

    private final int code;
    private final String description;

    TransportType(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public static TransportType fromCode(int code) {
        for (TransportType status : TransportType.values()) {
            if (status.getCode() == code) {
                return status;
            }
        }
        throw new IllegalArgumentException("状态异常: " + code);
    }
}